<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="java.net.URLEncoder"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商品分类</title>
</head>
<body>
<h1>选择分类</h1>
<ul>
<c:forEach items="${categories}" var="category1">
	<li>
		${category1.name}
		<ul>
		<c:forEach items="${category1.children}" var="category2">
			<li>
				<c:set var="link" value="${category2.link}" scope="request"></c:set>
				<%
				String link = (String)request.getAttribute("link");
				link = URLEncoder.encode(link,"utf-8");
				%>
				<a href="products?type=${param.type}&link=<%=link %>">${category2.name}</a>				
			</li>
		</c:forEach>
		</ul>
	</li>
</c:forEach>
</ul>
</body>
</html>